home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / misc-part2 / 12171 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  8.4 KB

  1. Path: blue.cse.ogi.edu!leneis
  2. From: leneis@blue.cse.ogi.edu (Tony Leneis)
  3. Newsgroups: comp.sys.amiga.misc
  4. Subject: Re: AmigaOS 4.x features
  5. Date: 12 Apr 1996 23:43:55 GMT
  6. Organization: Oregon Graduate Institute (OGI), Portland, Oregon
  7. Message-ID: <4kmprr$2gb@reuter.cse.ogi.edu>
  8. References: <4j7ein$a6v@B1FF.mindspring.com> <4jkg5j$dva@B1FF.mindspring.com> <4jl6pr$knv@reuter.cse.ogi.edu> <4kkf60$268e@mule1.mindspring.com>
  9. NNTP-Posting-Host: blue.cse.ogi.edu
  10.  
  11. Charlie Moody <chmood@photobooks.atdc.gatech.edu> wrote:
  12. >On 31 Mar 1996 05:56:11 GMT, Tony Leneis wrote:
  13. >: test#a       <- Matches 'test', 'testa', 'testaa', 'testaaa', etc.
  14. >
  15. >  test*a       <- Matches 'test', 'testa', 'testaa', 'testaaa', etc.
  16.  
  17. test*a also matches 'testba', 'testbadfilea', 'test1234a', etc. while
  18. test#a only matches test followed by zero or more a's.  It's not the
  19. same thing.
  20.  
  21. >: test#(ab)c   <- Matches 'testc', 'testabc', 'testababc', 'testabababc', etc.
  22. >
  23. >Ya got me on this one...but do you (does anyone) *really* use such 
  24. >screwball naming conventions?
  25.  
  26. Not often, but it can be handy from time to time, especially when you're
  27. dealing with a slew of data files that follow some sort of a regular
  28. naming scheme.  A more common one for me would be something like 'data#[0-9]',
  29. which selects any file named data followed by zero or more digits.
  30.  
  31. >: On the other hand, there are no UNIX globbing patterns which cannot be
  32. >: expressed as an Amiga pattern.  Hence, Amiga patterns are more powerful.
  33. >
  34. >It's afloor wax!  It's a breath mint!  It's BOTH!!!  As I said...
  35.  
  36. I wasn't trying to sell it - I was simply trying to point out that the Amiga
  37. patterns are more powerful than UNIX globbing patterns.  I don't have your
  38. original post anymore, but as I recall you were complaining that the Amiga
  39. pattern matching was not as powerful as what is provided by UNIX shells, which
  40. just is not true.
  41.  
  42. >Please understand:  it's not my intention to insult my own machine 
  43. >(currently a much-upgraded 2000, replacing my grey-bearded 1000, which is 
  44. >now sunning itself in the back 40);  my comments were directed at making 
  45. >the *CLI* more flexible/convenient.  File globbing or not, I have always 
  46. >found the standard Amiga pattern-matching to be less simple, less 
  47. >intuitive, and hence less useful when moving bunches of files around 
  48. >(which I do...a lot....).
  49.  
  50. Point taken.  If that had been all your original post had said, I probably
  51. would have left it alone.  I just had a problem with the 'not as powerful
  52. as' and 'poorly designed' bits of the post.  The Amiga pattern matching
  53. syntax is different from UNIX's file globbing, but then again it's also
  54. different from VMS's and MS-DOS's...  It is not less powerful.
  55.  
  56. >: Would you have preferred the standard UNIX regular expression
  57. >: syntax?  Then you'd have to type '.*' instead of '#?', and you'd have to
  58. >: remember to escape the '.' whenever you didn't want it to act as the Amiga
  59. >: '?' metacharacter.  (Kind of a bummer if you're looking for '#?.c', or should
  60. >: I say '.*\.c' as a UNIX regular expression.)
  61. >
  62. >???  I've never encountered such a thing as you seem to be describing, 
  63. >from System III thru the current (Vr4?).  Certainly I've never had to 
  64. >jump thru *these* hoops on a unix box.
  65.  
  66. Note that I was talking about regular expressions there.  I don't know of any
  67. UNIX shell that provides regular expressions for file expansion purposes, but
  68. it's what many of the utilities use: awk; egrep and grep; ed, ex, sed, and vi;
  69. and csplit to name a few.  This means that you have to learn two types of
  70. pattern matching for UNIX.  The nice thing about the Amiga's pattern matching
  71. is that it's sufficiently general to be used anywhere that regular expressions
  72. would be useful, and it doesn't suffer from UNIX regular expression's
  73. unfortunate choice of metacharacters.  (Unfortunate when working with common
  74. filename pattern matching, anyway.)
  75.  
  76. >Or, to quote some old fart:  "It's not that the bear sings well:  it's 
  77. >that the bear sings at all."  Or another:  "Use the right tool for the job."
  78.  
  79. Exactly.  In my experience, I've found myself wishing that UNIX shells provide
  80. the same functionality as the Amiga's pattern matching.  Actually, when you
  81. get down to it, I think the pattern matching provided by WB 3.0 and above
  82. pretty much does what you want, except that you have to use a utility to turn
  83. on the map-*-as-#? function.  All the other metacharacters work the same,
  84. except that you have to use '~' instead of '^' to compliment sets.
  85. Incidentally, another bonus of 3.1 over 2.04 is all the ADOS commands accept
  86. multiple filenames.  2.04 used to drive me nuts when I wanted to delete 3 or
  87. 4 files that were not practical to generate patterns for.
  88.  
  89. >: Just out of curiosity, whose wheel should they have
  90. >: used instead of inventing their own?  As far as I know, there was no RFC or
  91. >: other standard for file wildcarding when AmigaDOS was developed.  Which UNIX
  92. >: shell should they have followed?
  93. >
  94. >This is just a *bit* disingenuous, doncha think?  Do you believe standards
  95. >grow on RFC's?  Taking what works and improving it is a time-honored way
  96. >of making progress. 
  97.  
  98. Not really.  You complained that the Amiga's pattern matching was different
  99. from everybody else's.  I was just wondering whose scheme they should have
  100. followed.  Heck, no two UNIX shells agree on filename expansion, other than
  101. '*', '?', and perhaps the '[]' pair (some shells don't know what to do with
  102. '[^A-Z]'.)
  103.  
  104. >Much more useful FOR WHAT?  I say it's not more useful, in my experience, 
  105. >for moving masses of files around from the command line, because in my 
  106. >experience it's *not* more useful.  It may be just the thing for 
  107. >complementing complex scripted functions, but I don't care, really.  If I 
  108. >wanted to do enough studying to master that art, I'd tackle perl, or Python.
  109.  
  110. And my experiences have been just the opposite.  Then again, at work I have
  111. to deal with tens of thousands of files that follow regular naming
  112. conventions (e.g. an embedded date or sequence number).  There have been
  113. many situations where I've really wanted ADOS's pattern matching power.
  114. Fortunately, I was able to port GNU find to the UNIX boxes I work on, so
  115. I'm able to do regular expression matching; however, typing things like
  116.  
  117. find . -regex '\./eft[0-9]*\.dat' -maxdepth 1 -exec rm {} \;
  118.  
  119. under UNIX is not as convenient as typing
  120.  
  121. delete eft#[0-9].dat
  122.  
  123. on the Amiga.  To be fair, find is an incredibly powerful command that can
  124. do all sorts of cool things; however, I have to use it or write some custom
  125. script that uses sed or grep or something in order to get regexp capable
  126. pattern matching.  The shells I have available (sh, ksh, and bash) can't
  127. hack it.
  128.  
  129. >Granted, I was working on unix boxes long before I got my 1000, and I'm 
  130. >*used* to doing certain things w/ the cli;  for me, it seems that the 
  131. >unix command line was designed as a primary interface, and the Amiga cli 
  132. >does not improve on it, and doesn't even equal it, in ease of common 
  133. >use.  I've managed to avoid MooseDOS for most of my career, and I'm very 
  134. >pleased about that;  and I don't *want* to run Linux or whatever:  I 
  135. >*like* my machine!
  136.  
  137. I'm just the opposite - I didn't start using UNIX with any frequency until
  138. 1987, so I'd already learned the Amiga's pattern matching.  I agree that
  139. the Amiga CLI could use a makeover; however, I don't see anything really
  140. wrong with the pattern matching.
  141.  
  142. >*sigh*  This wasn't meant to be a fight;  and as you say, the 
  143. >functionality I asked for is substantially available to me now on my 
  144. >Amiga, so this really is a moot point.
  145.  
  146. Agreed.  Really, the only thing I was attempting to point out was that
  147. the Amiga pattern matching is not less powerful than what UNIX shells
  148. provide, and that there is nothing wrong with the design.  It *is* 
  149. different, and the learning curve is steeper (because there are more
  150. meta characters to learn), but that's it.  It's certainly not underpowered
  151. or a kludge.  Personally, I feel that the manuals could use a little work
  152. on explaining how Amiga pattern matching works, but I don't think it should
  153. be scrapped.  If you think it should be redone because you don't care for
  154. the syntax and semantics, that's fine.  I only objected to the incorrect
  155. statement that AmigaDOS pattern matching was less powerful than UNIX shell
  156. pattern matching being presented as fact.
  157.  
  158. -Tony
  159. -- 
  160. =====///===Hi!==I'm=a=.signature=virus!==Copy=me=to=your=.signature!===///==
  161. __  /// leneis@cse.ogi.edu          From the desk of:   Hillary,  __  ///   
  162. \\\///  tony@plaza.ds.adp.com       -->Tony Leneis<--   Gennifer, \\\///Only
  163.  \XX/   aleneis@gauss.math.hmc.edu  HMC '91  Go Stags!  AND NOW US!\XX/Amiga
  164.